{% load services %}
{% url railroad.viewhosts.views.hostconfigurator host_name as host_link %}
{% url railroad.viewhosts.views.service host_name service_description as service_link %}
<tr class="service_row">
    <td class="controls">
        <input type="checkbox" class="graphcheckbox">
    </td>
    <td class="status_text state_{{ current_state|state_name|lower }}">
        <dl>
            <dt name="host">Host</dt>
            <dd name="host">
                <a href="{{host_link}}">{{host_name}}</a>
            </dd>

            <dt name="service">Service</dt>
            <dd name="service">
                <a href="{{service_link}}">{{service_description}}</a>
            </dd>

            <dt name="duration">Duration</dt>
            <dd name="duration" value="{{state_duration}}">
                {{ state_duration|pretty_duration }}
            </dd>

            <dt name="output">Output</dt>
            <dd name="output">{{ plugin_output}}</dd>

            <dt name="lastcheck">Last check</dt>
            <dd name="lastcheck">{{ last_check }}</dd>

            <dt name="attempts">Attempts</dt>
            <dd name="attempts">{{ current_attempt }}/{{ max_attempts}}</dd>

            <dt>Nagcat Test</dt>
            <dd>{{ nagcat_template }}</dd>
        </dl>
    </td>

    <td class="graph_container">
        {% if is_graphable %}
            <div class="options">
                Current
                <ul class="liButtons">
                    <li name="day" class="currentTime">Day</li>
                    <li name="week"class="currentTime">Week</li>
                    <li name="month"class="currentTime">Month</li>
                    <li name="year"class="currentTime">Year</li>
                </ul>
            </div>
            <div class="daterange">
                From <input type="text" name="from"/>
                To <input type="text" name="to"/>
            </div>
            <a href="{{host_name}}/{{service_description}}/{{start}}/{{end}}/100"></a>
            <div class="graphloading">Loading Data...</div>
        {% else %}
            <p class="nograph">No graph</p>
        {% endif %}
        {% if is_graphable %}
        <div class="{{slug}} graphInfo graph ajax" name="{{slug}}"> 
            <div id="{{ host_name }}" class="graph_hostname"></div>
            <div id="{{ service_description }}" class="graph_service_name"></div>
            <div id="{{ start }}" class="graph_start"></div>
            <div id="{{ end }}" class="graph_end"></div>
        </div>
        {% else %}
        <div class="{{slug}} graphInfo noGraph">
            <div id="{{ host_name }}" class="graph_hostname"></div>
            <div id="{{ service_description }}" class="graph_service_name"></div>
        </div>
        {% endif %}
        <div class="legend"></div>
    </td>
</tr>
